import logging

logger = logging.getLogger(__name__)

logger.setLevel(logging.ERROR)

handler = logging.FileHandler("test.log")

formatter = logging.Formatter(
    "%(asctime)s %(levelname)s [%(name)s] [%(filename)s (%(funcName)s:%(lineno)d)] - %(message)s"
)

handler.setFormatter(formatter)

logger.addHandler(handler)


if __name__ == "__main__":
    logger.debug("This is a debug message")
    logger.info("This is an info message")
    logger.warning("This is a warning message")
    logger.error("This is an error message")
    logger.critical("This is a critical message")
